1. Field of the Invention
The present invention relates to a texture compressing device and method. The device and method are for compressing texture image data. Texture images are used in realizing optical characteristics of an object surface that change in accordance with viewpoint directions and light source directions in texture mapping.
The present invention also relates to a texture decompressing device and method used in decompressing original texture images from texture image data compressed by the aforementioned texture compressing device or method.
The present invention also relates to data structures of texture images compressed by the aforementioned texture compressing device or method.
The present invention also relates to a storage medium in which is stored data of the aforementioned data structure.
2. Description of the Related Art
The appearance of a three-dimensional(3D) object depends on the following three factors: the shape of the object, the color of its surface, and the texture of its surface. These factors change with the direction of the viewpoint (viewpoint direction) and the direction of the light source (light source direction).
In the field of 3D computer graphics, a 3D object is drawn in the following manner. First, the surface of the 3D object is divided into a plurality of polygons. Then, each polygon is drawn as a two-dimensional image. When the viewpoint direction or the light source direction changes, the orientation of each polygon (three-dimensional position) and the optical characteristics of the polygons (e.g., intensity) are changed.
The orientation of the polygons is defined by normals of the polygons. In order to calculate the relation between the normals of the polygons and the viewpoint direction or the light source direction, vector calculation of floating point accuracy has been necessary. It has been difficult to make such a vector calculation, because a very-high-performance processor and very complex software have been needed.
Thus, a plurality of methods for changing the orientation and optical characteristics of the polygons by using simple calculations have been proposed. Texture mapping is one of these methods. Texture mapping is a method that pastes (maps), on a polygon surface, a polygonal image (texture image) whose pattern and design are drawn. This method is possible to express detailed portions of the polygon interior, such as its pattern.
Texture mapping has been improved in order to enable higher quality drawing. For example, there are a method of defining the texture image coordinates based on the vertices of the polygons in order to control the orientation of the texture image, and a method that uses a photograph for the texture image. However, there is a problem even with these improved texture mapping methods. Because a single texture image is pasted regardless of the 3D position of the polygon, the methods cannot express the optical characteristics of the object surface that change in accordance with the viewpoint direction and the light source direction.
Several improved methods for expressing the optical characteristics of an object surface have been pgroposed.
(1) “Bump Mapping” is a method that minutely changes the orientation of the normal of an object surface to determine changes in optical characteristics. This method uses 3D vector calculations, such as calculation of the normal. Thus, this method has the problem that there are many calculations required.
(2) In Dana, et. al, “Reflectance and Texture of Real World Surfaces”, ACM Transaction on Graphics, 18(1): 1-34, 1999, a method called BTF (Bi-directional Texture Function) has been proposed. BTF is a method that expresses texture components of a polygon surface in accordance with the viewpoint direction and the light source direction.
Each of the viewpoint direction and the light source direction can be represented by two variables. However, there has been no example of BTF in which sampling of an image has been conducted while changing all four variables representing the viewpoint direction and the light source direction. A case has been proposed where a subset, in which two or three variables are changed, has been handled. Such a case is described, for example, in Chen., et. al, “Light Field Mapping Efficient Representation and Hardware Rendering of Surface Light Fields”, Proceedings SIGGRAPH 2002, pp. 447-456.
(3) A method called PTM (Polynomial Texture Mapping) has been disclosed in U.S. Pat. No. 6,297,834. PTM is a method that approximates, with a function, intensity changes dependent on the light source direction and the viewpoint direction. In this method, the light source direction is expressed in two dimensions. The intensity of each pixel is approximated with a secondary function of the two variables representing the light source direction. Each texture retains six coefficients of this secondary function as parameters for expressing the intensity changes. By using these parameters, a change in the light source direction can be expressed.
Most graphics devices of recent years have a pixel shader. A pixel shader is a function for conducting shading by using a programmed calculation unit on the hardware. A pixel shader accelerates calculations such as PTM.
When intensity changes are mapped in consideration of a change of the viewpoint direction, it is necessary to generate a higher order function than in the case of only the light source direction. The number of coefficients of the function will increase and the amount of time for function approximation will be large. Thus, it is difficult to generate textures in consideration of both the viewpoint direction and the light source direction, when using PTM.
(4) Image base rendering has been proposed in Light Field Rendering (Levoy et. al, “Light Field Rendering”, Proceedings SIGGRAPH 1996, pp. 31-42) and Lumigraph (Gortler, et. al, “The Lumigraph”, Proceedings SIGGRAPH 1996, pp. 43-54). In this method, an image seen from a certain viewpoint direction is generated by interpolation using a plurality of viewpoint direction images that have been prepared in advance.
In this method, in order to raise image quality and the flexibility of the viewpoint direction, it is necessary to increase the number of viewpoint directions of the images prepared in advance. There is a tendency for the data amount of the images prepared in advance to become enormous. In order to compress the data, compression-rate-fixed vector quantization or predictive coding using an image of a similar viewpoint direction is used. Vector quantization has been proposed in, for example, U.S. Pat. No. 6,097,394.
However, in the image-base rendering methods proposed up to this point, the changes dependent on the light source direction have not been considered.
As mentioned above, in the methods proposed up to this point, it is necessary to prepare a large-volume of texture images where the viewpoint directions and the light source directions are different, and the methods have problems such as there being many calculations. Thus, a method that expresses, with textures, the optical characteristics of an object surface that change in accordance with the viewpoint direction and the light source direction has not been provided as a practical system.